package creational.builder;

public class Test {

    public static void main(String[] args) {
        //通过不同的构造者接口实现类，能够创建不一样的对象。
        IntelBuilder pIntelBuilder = new IntelBuilder();
        ComputerDirector pIntelDirect = new ComputerDirector(pIntelBuilder);
        //导演类能够让构建者实现类按照一定的顺序执行构建者中的多个方法，统一的构建过程
        pIntelDirect.installComputer();
        Computer pIntelComputer = pIntelBuilder.createComputer();
        System.out.println(pIntelComputer.toString());

        AmdBuilder pAmdBuilder = new AmdBuilder();
        ComputerDirector pAmdDirect = new ComputerDirector(pAmdBuilder);
        pAmdDirect.installComputer();
        Computer pAmdComputer = pAmdBuilder.createComputer();
        System.out.println(pAmdComputer.toString());
    }

}
